Plots

Row

Number of Penguins

344

Avg Body Mass (g)

Column

Scatter Plot of Bill Length vs Bill Depth

Boxplot of bodymass

Histogram of flipper length

Data

---
title: "Advanced Dashboarding Class"
output: 
  flexdashboard::flex_dashboard:
    orientation: row
    vertical_layout: fill
    social: ["menu"]
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(palmerpenguins)
library(DT)
library(fontawesome)
library(plotly)
data("penguins")
```




Plots
=======================================================================

Sidebar {.sidebar}
-----------------------------------------------------------------------

### Penguin Stats

The total number of penguins in the data set is `r nrow(penguins)`

Row
-----------------------------------------------------------------------

### Number of Penguins

```{r}
valueBox(nrow(penguins), icon = "fa-linux")
```

### Avg Body Mass (g)

```{r}
avg_mass = round(mean(penguins$body_mass_g, na.rm = T), 1)
gauge(avg_mass, 
      min = 0, 
      max = max(penguins$body_mass_g, na.rm = T),
      gaugeSectors(success = c(4000, 6300),
                   warning = c(2000, 3999),
                   danger = c(0,1999)))
```


Column {.tabset}
-----------------------------------------------------------------------

### Scatter Plot of Bill Length vs Bill Depth

```{r}
a = penguins %>% ggplot(aes(x = bill_length_mm, y = bill_depth_mm, color = species))+
  geom_point() 

ggplotly(a)

#htmlwidgets.org
```


### Boxplot of bodymass

```{r}
penguins %>% ggplot(aes(x = body_mass_g, y = sex, fill = species))+
  geom_boxplot()
```

### Histogram of flipper length

```{r}
penguins %>% ggplot(aes(x = flipper_length_mm, fill = species))+
  geom_histogram()+
  facet_wrap(~species)
```

Data
================================================================================

```{r}
penguins %>% datatable(extensions = "Buttons",
                       options = list(dom = "Blfrtip",
                                      buttons = c("copy", "csv", "excel", "pdf", "print")))
#datatables.net    

```